package com.home.demo.security;

import com.home.demo.entity.vo.user.UserLoginVO;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;

@Data
public class SecurityUserDetailsImpl implements UserDetails, Serializable {


    public UserLoginVO userLoginVO;

    SecurityUserDetailsImpl(UserLoginVO userEntity){
        this.userLoginVO=userEntity;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return userLoginVO.getPassword();
    }

    @Override
    public String getUsername() {
        return userLoginVO.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
